<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
				xmlns:h="http://java.sun.com/jsf/html"
				xmlns:p="http://primefaces.org/ui"
				xmlns:f="http://java.sun.com/jsf/core"
				xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:c="http://java.sun.com/jsp/jstl/core"
				template="./template.xhtml">

    <ui:define name="htmlHead">
        <title>#{bundle['nav.login']}</title>
    </ui:define>

	<ui:define name="topbar">
		#{bundle['nav.welcome']}
	</ui:define>

    <ui:define name="content">
		<div class="row">
			<div class="span8">
				<h:form class="form-horizontal"> 
					<fieldset>

                                            <legend>#{bundle['action.create.account']}</legend>

						<div class="control-group"> 							
                                                    <h:outputLabel for="email" value="#{bundle['user.email']}" class="control-label" />  
							<div class="controls">
								<p:inputText id="email" required="true" label="email" value="#{userManager.signinUser.email}" />  
								<h:message for="email" class="help-block" />
							</div>
						</div>

						<div class="control-group"> 							
                                                    <h:outputLabel for="password" value="#{bundle['user.pass']}" class="control-label" />  
							<div class="controls">
								<p:password  id ="password" required="true" label="password" value="#{userManager.signinUser.password}" />
								<h:message for="password" class="help-block" />
							</div>
						</div>

						<div class="control-group"> 							
                                                    <h:outputLabel for="fullName" value="#{bundle['user.fullName']}" class="control-label" />  
							<div class="controls">
								<p:inputText id="fullName" required="true" label="fullName"  value="#{userManager.signinUser.fullName}" >  
									<f:validateLength minimum="2" />  
								</p:inputText>  
								<h:message for="fullName" class="help-block" /> 
							</div>
						</div>

						<div class="control-group"> 							
                                                    <h:outputLabel for="nickname" value="#{bundle['user.nickName']}" class="control-label" />  
							<div class="controls">
								<p:inputText id="nickname" required="true" label="nickname"  value="#{userManager.signinUser.nickname}" />  
								<h:message for="nickname"  class="help-block" /> 
							</div>
						</div>

						<div class="control-group"> 							
                                                    <h:outputLabel for="company" value="#{bundle['user.company']}" class="control-label" />  
							<div class="controls">
								<p:inputText id="company" required="true" label="company"  value="#{userManager.signinUser.company}" />  
								<h:message for="company"  class="help-block" />
							</div>
						</div>

						<div class="form-actions">
                                                    <p:commandButton value="#{bundle['action.create.user']}" update="@form,:growl" action="#{userManager.signin}" styleClass="btn btn-success" />&nbsp;
                                                    <p:commandButton value="#{bundle['action.cancel']}" type="reset" update="@form" action="#{userManager.signinReset()}" styleClass="btn" />
						</div>
					</fieldset>
				</h:form>
			</div>
			
			<div class="span4">
				<h3>#{bundle['nav.text.account']}</h3>
				<p>#{bundle['nav.text.signin']}</p>
				<h:form>
					<p><h:link value="#{bundle['action.access.account']}" outcome="/login" class="btn btn-primary" /></p>
				</h:form>
				
				<hr />
				
                                <h3>#{bundle['nav.text.mode']}</h3>
				<p>#{bundle['nav.text.example1']} <code>demo@mail.com</code> #{bundle['nav.text.example2']} 
					<code>demo</code>. #{bundle['nav.text.example3']}
				</p>

			</div>
		</div>

	</ui:define>

</ui:composition>
